
class SystemTreeEntity {
    List<SystemTreeData>? data;
    int? errorCode;
    String? errorMsg;

    SystemTreeEntity({this.data, this.errorCode, this.errorMsg});

    SystemTreeEntity.fromJson(Map<String, dynamic> json) {
        if(json["data"] is List)
            this.data = json["data"]==null ? null : (json["data"] as List).map((e)=>SystemTreeData.fromJson(e)).toList();
        if(json["errorCode"] is int)
            this.errorCode = json["errorCode"];
        if(json["errorMsg"] is String)
            this.errorMsg = json["errorMsg"];
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        if(this.data != null)
            data["data"] = this.data?.map((e)=>e.toJson()).toList();
        data["errorCode"] = this.errorCode;
        data["errorMsg"] = this.errorMsg;
        return data;
    }
}

class SystemTreeData {
    List<SystemTreeDataChildren>? children;
    int? courseId;
    int? id;
    String? name;
    int? order;
    int? parentChapterId;
    bool? userControlSetTop;
    int? visible;

    SystemTreeData({this.children, this.courseId, this.id, this.name, this.order, this.parentChapterId, this.userControlSetTop, this.visible});

    SystemTreeData.fromJson(Map<String, dynamic> json) {
        if(json["children"] is List)
            this.children = json["children"]==null ? null : (json["children"] as List).map((e)=>SystemTreeDataChildren.fromJson(e)).toList();
        if(json["courseId"] is int)
            this.courseId = json["courseId"];
        if(json["id"] is int)
            this.id = json["id"];
        if(json["name"] is String)
            this.name = json["name"];
        if(json["order"] is int)
            this.order = json["order"];
        if(json["parentChapterId"] is int)
            this.parentChapterId = json["parentChapterId"];
        if(json["userControlSetTop"] is bool)
            this.userControlSetTop = json["userControlSetTop"];
        if(json["visible"] is int)
            this.visible = json["visible"];
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        if(this.children != null)
            data["children"] = this.children?.map((e)=>e.toJson()).toList();
        data["courseId"] = this.courseId;
        data["id"] = this.id;
        data["name"] = this.name;
        data["order"] = this.order;
        data["parentChapterId"] = this.parentChapterId;
        data["userControlSetTop"] = this.userControlSetTop;
        data["visible"] = this.visible;
        return data;
    }
}

class SystemTreeDataChildren {
    List<dynamic>? children;
    int? courseId;
    int? id;
    String? name;
    int? order;
    int? parentChapterId;
    bool? userControlSetTop;
    int? visible;

    SystemTreeDataChildren({this.children, this.courseId, this.id, this.name, this.order, this.parentChapterId, this.userControlSetTop, this.visible});

    SystemTreeDataChildren.fromJson(Map<String, dynamic> json) {
        if(json["children"] is List)
            this.children = json["children"] ?? [];
        if(json["courseId"] is int)
            this.courseId = json["courseId"];
        if(json["id"] is int)
            this.id = json["id"];
        if(json["name"] is String)
            this.name = json["name"];
        if(json["order"] is int)
            this.order = json["order"];
        if(json["parentChapterId"] is int)
            this.parentChapterId = json["parentChapterId"];
        if(json["userControlSetTop"] is bool)
            this.userControlSetTop = json["userControlSetTop"];
        if(json["visible"] is int)
            this.visible = json["visible"];
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        if(this.children != null)
            data["children"] = this.children;
        data["courseId"] = this.courseId;
        data["id"] = this.id;
        data["name"] = this.name;
        data["order"] = this.order;
        data["parentChapterId"] = this.parentChapterId;
        data["userControlSetTop"] = this.userControlSetTop;
        data["visible"] = this.visible;
        return data;
    }
}